home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / netbsd_noexec.txt < prev    next >
Encoding:
Internet Message Format  |  1999-03-24  |  2.9 KB

  1. Date: Thu, 18 Mar 1999 21:27:39 +1100
  2. From: matthew green <mrg@ETERNA.COM.AU>
  3. To: BUGTRAQ@netspace.org
  4. Subject: NetBSD Security Advisory 1999-007
  5.  
  6. -----BEGIN PGP SIGNED MESSAGE-----
  7.  
  8.                  NetBSD Security Advisory 1999-007
  9.                  =================================
  10.  
  11. Topic:          noexec mount flag is not properly handled by non-root mount
  12. Version:        NetBSD 1.3.3 and prior; NetBSD-current until 19990318
  13. Severity:       Local users can execute binaries they're not allowed to
  14.  
  15.  
  16. Abstract
  17. ========
  18.  
  19. On a system where all partitions writable by regular users are mounted with
  20. the `noexec' option, a regular user should not be able to execute a binary
  21. which was not put on the system by the administrator.  Insufficient checks
  22. in the mount system call may allow a regular user to mount a device,
  23. remote host or local directory without the `noexec' option, allowing them
  24. to execute arbitrary binaries.
  25.  
  26.  
  27. Technical Details
  28. =================
  29.  
  30. The mount syscall does not require root privileges, it only requires that
  31. the user has read access to the target and is owner of the mount point.
  32. For such mounts, the `nosuid' and `nodev' flags, which disable set-id
  33. executables and device special files respectively, are automatically handled
  34. by the mount system call, but not the `noexec' flag, which disables the
  35. ability to execute binaries on this partition.  This allows a regular
  36. user to perform a mount on a mount point he owns, and then execute binaries
  37. >from this mount point, even if the mount point was initially in a sub-tree
  38. of the global filesystem mounted with the `noexec' option.  The easiest way
  39. to bypass a `noexec' restriction is to use a nullfs mount, but a NFS mount,
  40. or a mount from a readable block device can allow it as well.
  41.  
  42.  
  43. Solutions and Workarounds
  44. =========================
  45.  
  46. A patch is available for the NetBSD 1.3.3 which makes the mount system call
  47. inherit the `noexec' flag from the mount point.  You may find this patch on
  48. the NetBSD ftp server:
  49.  
  50.     ftp://ftp.NetBSD.ORG/pub/NetBSD/misc/security/patches/19990317-mount
  51.  
  52. NetBSD-current since 19990318 is not vulnerable.  Users of NetBSD-current
  53. should upgrade to a source tree later than 19990318.
  54.  
  55.  
  56. Thanks To
  57. =========
  58.  
  59. Manuel Bouyer <bouyer@antioche.lip6.fr> for the solution.
  60.  
  61.  
  62. Revision History
  63. ================
  64.  
  65.         1999/03/17 - initial version
  66.  
  67.  
  68. More Information
  69. ================
  70.  
  71. Information about NetBSD and NetBSD security can be found at
  72. http://www.NetBSD.ORG/ and http://www.NetBSD.ORG/Security/.
  73.  
  74.  
  75. Copyright 1999, The NetBSD Foundation, Inc.  All Rights Reserved.
  76.  
  77. $NetBSD: NetBSD-SA1999-007.txt,v 1.1 1999/03/18 07:35:55 mrg Exp $
  78.  
  79. -----BEGIN PGP SIGNATURE-----
  80. Version: 2.6.3ia
  81. Charset: noconv
  82.  
  83. iQCVAwUBNvCxMz5Ru2/4N2IFAQFWkAQAlHWahlMRPWuribmek9zc/incJeGi8OWj
  84. TxxZY2OPMPluEkmOT30xsGtpNZWKaDUv8g1q6X3KBnYsZFonS5RW/AhClSha5nCL
  85. Kx4GiG/9KNK07a06F0G+WjxOrAXSSvh0UyxLbn6E7VJa7/g8h2Uk3osG5SNMkuvj
  86. qTfmCofhnKI=
  87. =TH30
  88. -----END PGP SIGNATURE-----
  89.  
  90.